﻿using T4UtilityBelt.DataDesigns;
using T4UtilityBelt.Writers;

namespace T4UtilityBelt.UxDesigns.Controls.Renderers.ViewModel
{
    public class ParentManyRenderer : ParentRenderer<ParentManyControl, IParentManyRenderer, ParentMany>, IParentManyRenderer
    {
        protected override void OnRenderUiXmlContentInput(ParentManyControl control, CodeWriter writer)
        {
        }

        protected override void OnRenderUiXmlContentReadOnly(ParentManyControl control, CodeWriter writer)
        {
        }

        protected override void OnRenderUiCode(ParentManyControl control, CodeWriter writer)
        {
            writer.WriteFormatLine(
@"      public {0}Collection {0}List
        {
            get
            {
                return {0}Pickers.Items().Result;
            }
        }
",
            control.Property.ToName
);
        }
    }
}